package org.example.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author guocb
 * @since 2021-03-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("smbms_permission")
public class Permission implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String name;

    /**
     * 0 按钮 1 菜单
     */
    private Integer type;

    private String code;

    private String url;

    private Integer parentId;

    @TableField(exist = false)
    private Long roleId;

    @TableField(exist = false)
    private List<Permission> permissions = new ArrayList<>();

    public static final String ID = "id";

    public static final String NAME = "name";

    public static final String TYPE = "type";

    public static final String CODE = "code";

    public static final String URL = "url";

    public static final String PARENTID = "parentId";

}
